package com.supermap.business.product.template;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dubbo.api.product.template.ProductTemplateSerivce;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

/**
 * @author aqua
 * @description 决策产品模板
 * @date 2018年11月08 下午 5:27
 * @email 1301584033@qq.com
 */
@Controller
@CrossOrigin
@RequestMapping("/product/template")
public class ProductTemplateController {

    @Reference(timeout = 10000)
    private ProductTemplateSerivce productTemplateSerivce;
       /**
        * 获取决策服务产品
        * */
       @RequestMapping("/getListProductTemplate")
       @ResponseBody
     public  List<Map<String,Object>> getListProductTemplate(){
        return productTemplateSerivce.getListProductTemplate();
     }
    @GetMapping("/getProductGrupByTemplateId")
    @ResponseBody
    public JSONUtil getProductGrupByTemplateId(Integer areaCode, Integer templateId) {
        return   productTemplateSerivce.getProductGrupByTemplateId(areaCode,templateId);
    }

}
